﻿IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_MediaContentAdd]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[cms_sp_MediaContentAdd]
GO
CREATE procedure [dbo].[cms_sp_MediaContentAdd]
(
@MediaId int,
@SiteId int,
@SiteGroupId int,
@MetaCode nvarchar(150),
@Description nvarchar(500),
@CreatedBy int,
@DateCreated datetime,
@LastUpdatedBy int,
@DateLastUpdated datetime,
@MediaContentName nvarchar(250)
)
as

declare @Id int

insert into dbo.MediaContents
   (MediaId
   ,SiteId
   ,SiteGroupId
   ,MetaCode
   ,[Description]
   ,CreatedBy
   ,DateCreated
   ,LastUpdatedBy
   ,DateLastUpdated
   ,MediaContentName)
values
   (@MediaId
   ,@SiteId
   ,@SiteGroupId
   ,@MetaCode
   ,@Description
   ,@CreatedBy
   ,@DateCreated
   ,@LastUpdatedBy
   ,@DateLastUpdated
   ,@MediaContentName)
set @Id = SCOPE_IDENTITY()

return @Id
           
go
